package com.ymttest.database.sqlwapper;

import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.utils.EnvSetup;

/************************************************************************************
 * @File name :DefaultWapper.java
 * @Author : zhouyi
 * @Date : 2015年6月1日
 * @Copyright : 洋码头
 ************************************************************************************/
public class XloboDefaultWapper {
	SqlManager manage;

	public XloboDefaultWapper() {
		manage = new SqlManager("xlobo" + EnvSetup.getEnv());
	}

	/**
	 * @param cid
	 *            产品CatalogId
	 * @return See YmtProductsInActivityWapper#selectNewActiveProductInfo
	 * @see XloboDefaultWapper#selectNewActiveProductInfo
	 * @throws InterruptedException
	 */
	public List<Map> selectTempBillPackageByPackageId(int PackageId) throws InterruptedException {
		@SuppressWarnings("unchecked")
		List<Map> pia = manage.getSelectResults(
				"com.ymttest.database.mapping.XloboDefaultMapper.selectTempBillPackageByPackageId", PackageId);
		return pia;
	}		
	/**
	 * 关闭数据库连接
	 */
	public void close() {
		manage.close();
	}

	@Override
	protected void finalize() throws Throwable {
		this.close();
		manage = null;
		super.finalize();
	}

	public static void main(String args[]) {
		try {
			List<Map> list = new XloboDefaultWapper().selectTempBillPackageByPackageId(1);
			for (Map map : list) {
				Logger.debug(map);
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
